package Factory;

/**
 * @author CC小天才
 * @website www.flyskill.cn
 * @date 2021/9/29 17:04
 **/

public class NvWa {

    public static void main(String[] args) {
        AbstractHumanFactory humanFactory=new HumanFactory();

        //造黑人
        Human BlackHuman=humanFactory.createHuman(BlackHuman.class);
        BlackHuman.getColor();
        BlackHuman.talk();

        //造白人

        Human WhiteHuman =humanFactory.createHuman(WhiteHuman.class);
        WhiteHuman.getColor();
        WhiteHuman.talk();

        //造黄种人

        Human YellowHuman=humanFactory.createHuman(Factory.YellowHuman.class);
        YellowHuman.getColor();
        YellowHuman.talk();
    }
}
